package dev.ece.suit.loader;

import java.io.InputStream;
import java.nio.FloatBuffer;
import java.util.Map;

import org.lwjgl.opengl.GL20;

import dev.ece.suit.utils.ShaderFunctions;

public class FrameModelShader extends ModelShader {
	
	private static FrameModelShader defaultModelShader;
	
	public static FrameModelShader getDefaultModelShader() {
		if(defaultModelShader == null) {
			defaultModelShader = new FrameModelShader(
					FrameModelShader.class.getClassLoader().getResourceAsStream("shaders/defer/framemodel3d.vert"),
					FrameModelShader.class.getClassLoader().getResourceAsStream("shaders/defer/framemodel3d.frag"),
					ShaderFunctions.getFunctions());
		}
		return defaultModelShader;
	}
	
	public FrameModelShader(StringBuffer vertexShaderString,
			StringBuffer pixelShaderString, Map<String, String> functions) {
		super(vertexShaderString, pixelShaderString, functions);
	}
	
	public FrameModelShader(InputStream vertexShaderInputStream,
			InputStream pixelShaderInputStream, Map<String, String> functions) {
		super(vertexShaderInputStream, pixelShaderInputStream, functions);
	}
	
	@Override
	protected void onInitializeHandler(int program) {
		super.setLocalSkeletonMatrixBuffer(null);
		super.setNormalSkeletonMatrixBuffer(null);
		super.onInitializeHandler(program);
	}
	
	@Override
	protected int createLocalSkeletonMatrixHandler(int program) {
		return 0;
	}

	@Override
	protected int createNormalSkeletonMatrixHandler(int program) {
		return 0;
	}

	@Override
	protected void onBindAttribLocations(int program) {
		GL20.glBindAttribLocation(program, 0, "ece_Vertex");
		GL20.glBindAttribLocation(program, 1, "ece_TexCoord");
		GL20.glBindAttribLocation(program, 2, "ece_Normal");
	}
	
	@Override
	public void glJointsLocalMatrix(Joint<?>[] joints) {
	}

	@Override
	public void setLocalSkeletonMatrixBuffer(FloatBuffer localSkeletonMatrixBuffer) {
	}

	@Override
	public void setNormalSkeletonMatrixBuffer(FloatBuffer normalSkeletonMatrixBuffer) {
	}

	@Override
	public void glUseProgram() {
		super.glUseProgram();
	}

	@Override
	public void clearup() {
		super.clearup();
	}
	
}
